package com.nananer7.servlet;

import com.nananer7.dao.CommentDao;
import com.nananer7.dao.UserDao;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class SearchServlet extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");

        HttpSession session = request.getSession();

        //得到表单提交的内容
        String search=request.getParameter("s");
        session.setAttribute("search",search);


        request.getRequestDispatcher("/search.jsp").forward(request, response);


    }
}
